package com.czkevin.cif.commands.main;

import com.czkevin.cif.CIFSubCommand;
import com.czkevin.cif.CustomItemFramework;
import com.czkevin.cif.commands.CIFMainCommand;
import org.bukkit.command.CommandSender;

public class DebugCommand implements CIFSubCommand {
    @Override
    public String getCommandName() {
        return "debug";
    }

    @Override
    public String getHelpParameters() {
        return "";
    }

    @Override
    public String getHelpText() {
        return "Turn on or off debug mode. ";
    }

    @Override
    public void execute(CommandSender sender, String[] args) {
        if (!sender.hasPermission(CIFMainCommand.PERMISSION)) return;
        CustomItemFramework.debug = !CustomItemFramework.debug;
        sender.sendMessage(String.format("CIF Debug mode is now: %s", CustomItemFramework.debug ? "+ENABLED" : "-DISABLED"));
    }
}
